fix: cold wallet signs for any genesis hash - #645
Merged
Conversation
The signer no longer rejects payloads whose genesis hash is not in its network table. The name is shown in Advanced when known, alongside the raw genesis hash which is always shown; unlisted chains such as mainnet sign like any other.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Scanning a payload from a chain whose genesis hash is not in the cold wallet's network table showed "Could not read transaction / Unknown genesis hash" and refused to sign. Mainnet's genesis hash is not known at build time, so the shipped cold wallet could never sign mainnet transactions.
Change
QuantusPayloadParser.parsePayloadno longer throws on an unlisted genesis hash.ParsedPayload.networkis now nullable: the display name fromknownNetworkswhen listed, otherwise null.Network:line: the known name, orUnknownwhen the genesis hash is not listed. The raw genesis hash line is unchanged and always shown.Follow-up once the mainnet genesis hash is known: #646.
Tests
network == nulland spec drift flagged.signablePayload; a widget test pumps the sign screen with a foreign genesis hash and checks it reaches review withNetwork: Unknownand the raw hash in Advanced.quantus_sdk/test/quantus_payload_parser_test.dartand the cold wallet signing, display, scan, and render suites pass.